# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness do
  @moduledoc """
  Service area businesses provide their service at the customer's location (for example, a locksmith or plumber).

  ## Attributes

  *   `businessType` (*type:* `String.t`, *default:* `nil`) - Required. Indicates the type of the service area business.
  *   `places` (*type:* `GoogleApi.MyBusinessBusinessInformation.V1.Model.Places.t`, *default:* `nil`) - The area that this business serves defined through a set of places.
  *   `regionCode` (*type:* `String.t`, *default:* `nil`) - Immutable. CLDR region code of the country/region that this service area business is based in. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland. This field is required for CUSTOMER_LOCATION_ONLY businesses, and is ignored otherwise. The region specified here can be different from regions for the areas that this business serves (e.g. service area businesses that provide services in regions other than the one that they are based in). If this location requires verification after creation, the address provided for verification purposes *must* be located within this region, and the business owner or their authorized representative *must* be able to receive postal mail at the provided verification address.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :businessType => String.t() | nil,
          :places => GoogleApi.MyBusinessBusinessInformation.V1.Model.Places.t() | nil,
          :regionCode => String.t() | nil
        }

  field(:businessType)
  field(:places, as: GoogleApi.MyBusinessBusinessInformation.V1.Model.Places)
  field(:regionCode)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.ServiceAreaBusiness do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
